const seq = require('sequelize')
const time = require('../time')
module.exports = {
  NAME: 'sys_menu',
  TABLE: {
    menu_id: {
      type: seq.INTEGER(11),
      allowNull: false,
      primaryKey: true,
      autoIncrement: true,
      comment: '菜单id',
      field: 'menu_id'
    },
    name: {
      type: seq.STRING(32),
      comment: '菜单名称',
      allowNull: false,
      field: 'name'
    },
    permission: {
      type: seq.STRING(32),
      comment: '菜单权限标识',
      field: 'permission'
    },
    path: {
      type: seq.STRING(128),
      comment: '前端URL',
      field: 'path'
    },
    url: {
      type: seq.STRING(128),
      comment: '请求链接',
      field: 'url'
    },
    method: {
      type: seq.STRING(32),
      comment: '请求方法',
      field: 'method'
    },
    parent_id: {
      type: seq.INTEGER(11),
      comment: '父级菜单id',
      field: 'parent_id'
    },
    icon: {
      type: seq.STRING(32),
      comment: '图标',
      field: 'icon'
    },
    component: {
      type: seq.STRING(64),
      comment: '组件',
      field: 'component'
    },
    sort: {
      type: seq.INTEGER(11),
      comment: '排序值',
      field: 'sort'
    },
    type: {
      type: seq.CHAR(1),
      comment: '菜单类型 (0菜单 1按钮)',
      field: 'type'
    },
    top_show:{
      type: seq.CHAR(1),
      comment: '顶部显示、只针对一级菜单 0--不显示 1--显示',
      field: 'top_show',
      defaultValue:'0'
    },
    del_flag: {
      type: seq.CHAR(1),
      comment: '0--正常 1--删除',
      defaultValue: '0',
      field: 'del_flag'
    },
    ...time.create_date,
    ...time.upadte_date
  }
}
